package xyz.dava.file.spring;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import xyz.dava.file.FileClient;

@RestController
@RequestMapping("/${dava.file.context}/file")
public class FileController {

    @Autowired
    private FileClient fileClient;

    @PostMapping
    public Object upload(MultipartFile file) {
        fileClient.uploadFile(file);
        return "success";
    }
}
